package com.ygqh.baby.service;

import java.math.BigDecimal;

import org.apache.log4j.Logger;

import com.ygqh.baby.ao.Message;

public abstract class AbstractService {

	protected Logger logger = Logger.getLogger(this.getClass());

	protected static final BigDecimal ZERO = new BigDecimal("0.00");
	protected static final BigDecimal ONE = new BigDecimal("1.00");

	protected static final Message SUCCESS_MESSAGE = new Message();
	protected static final Message ERROR_MESSAGE = new Message();
	{
		SUCCESS_MESSAGE.setType(Message.Type.success);
		SUCCESS_MESSAGE.setContent("操作成功");

		ERROR_MESSAGE.setType(Message.Type.error);
		ERROR_MESSAGE.setContent("操作失败");
	}

	protected String getContentPath() {
		String file = this.getClass().getResource("/").getPath();

		return file.substring(0, file.indexOf("WEB-INF"));

	}
}
